You are here: FAQ > Tips and Techniques > Merging Text

Merging Text

The system lets you define paragraphs of text with embedded variable fields. You create these paragraphs and save them as ordinary FAP files. Once created, the system can then load the paragraphs as template data at run time and merge data derived from field-level rules. The system reformats the resulting text, based on your form design, and includes it in the form data output stream.

Use this feature if the section has variables embedded in a text area which has the Can Grow and Shrink option turned on and the section is defined as Can Grow.

The TextMergeParagraph rule supports this feature. This rule checks to see if the FAP data for the requested section is currently loaded, and, if not, it loads it. As the system executes field rules, it propagates the data into the text area, causing necessary text reformatting. The section is flagged in memory as in-line so it will be treated as a template, rather than a static section. The system will unload the resulting FAP data into the data stream as dynamic content.

This section-level rule lets the GenData program load the entire fap file into the NA file so the GenPrint program can reformat the text and data at run time, even if the DownloadFAP option is set to No in the INI file.

Since the section is considered an in-line fap file, its precompiled overlay is not used by the GenPrint program. You can, however, use precompiled overlays when you have static and Can Grow sections to increase performance. Use this rule on an section-by-section basis.

For example, suppose a form is composed of five sections, of which four sections are static and one can grow. You can use the SendOverlays and DownloadFAP options and precompile the overlays for the four static sections. The GenPrint program uses the overlays for those static sections and reformats the text for the section with the TextMergeParagraph rule, using the information in the NAFILE.DAT file.

Note   The TextMergeParagraph rule, when used unnecessarily, slows performance, causing sections to be loaded and unloaded unnecessarily. This can create huge NAFILE.DAT file output. As with any rule, only call it when necessary. Also, the smaller the fap file, the better the performance.